package com.wzq.permission.center.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wzq.permission.client.model.admin.ApplicationUserModel;
import com.wzq.permission.client.model.admin.UserRoleModel;

/**
 * UserRole Mapper
 * @author 陈剑飞
 *
 */
public interface UserRoleMapper extends BaseMapper {
	/**
	 * 批量插入记录
	 * @param list
	 * @return
	 */
	int addBatch(List<UserRoleModel> list);
	
	/**
	 * 根据用户ID和系统ID删除用户角色
	 * @param userId 用户ID
	 * @param applicationId 系统ID
	 * @return int
	 */
	int deleteByUserAndAppId(@Param("userId")Long userId,@Param("applicationId")Long applicationId);
	
	/**
	 * 根据用户ID查询用户角色信息
	 * @param userId
	 * @return
	 */
	List<UserRoleModel> queryUserRole(@Param("userId")Long userId,@Param("applicationId")Long applicationId);
	/**
	 * 根据roleId 删除 关联信息
	 * @param roleId 角色id
	 */
	void deleteUserByRoleId(@Param("roleId")Long roleId);
}
